package com.hhxy.controller;

import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.hhxy.service.UploadService;
import com.hhxy.utils.response.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.io.IOException;

/**
 * @author ghp
 * @date 2023/4/29
 * @title
 * @description
 */
@Api(tags = "公共接口")
@ApiSupport(author = "ghp", order = 1)
@RestController
@RequestMapping("/upload")
public class UploadController {

    @Resource
    private UploadService uploadService;

    @PostMapping
    @ApiOperation("上传图片")
    public ResponseResult uploadImg(MultipartFile img) throws IOException {
        return uploadService.uploadImg(img);
    }
}